package com.mvp.lt.airlineview.start;
import com.mvp.lt.airlineview.base.BaseActivity;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.mvp.lt.airlineview.R;
import com.mvp.lt.airlineview.utils.LogUtil;
import com.mvp.lt.airlineview.utils.RxTimerUtil;
import com.mvp.lt.airlineview.HomeActivity;

import io.reactivex.disposables.Disposable;

/**
 * $activityName
 *
 * @author LiuTao
 * @date 2019/3/6/006
 */


public class GuideActivity extends BaseActivity {
    private String TAG = GuideActivity.class.getSimpleName();
    private RxTimerUtil mRxTimerUtil;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_guide);

        mRxTimerUtil = new RxTimerUtil();
        mRxTimerUtil.countTime(3, new RxTimerUtil.OnRxTimerListener() {
            @Override
            public void onSubscribe(Disposable d) {

            }

            @Override
            public void onNext(Integer integer) {
                LogUtil.e(TAG, integer + "");
            }

            @Override
            public void onError(Throwable throwable) {

            }

            @Override
            public void onComplete() {
                startActivity(new Intent(GuideActivity.this, HomeActivity.class));
                mRxTimerUtil.clearCountDownTime();
                finish();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mRxTimerUtil != null) {
            mRxTimerUtil.clearCountDownTime();
        }
        LogUtil.e(TAG,"------onDestroy------");
    }
}
